package com.mairuide.phone.phonetitle;

import com.mairuide._frame.base.BaseRepository;
import com.mairuide._frame.base.BaseServiceProxy;
import com.mairuide._frame.base.Constant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: zyj
 * @Date: 2019/3/28 15:34
 * @Description:
 */
@Service
public class PhoneTitleService extends BaseServiceProxy<PhoneTitle> {

    @Autowired
    private PhoneTitleDao phoneTitleDao;

    @Override
    protected BaseRepository<PhoneTitle> getBaseRepository() {
        return phoneTitleDao;
    }

    public PhoneTitle queryPhoneTitle(String title){
        PhoneTitle byTitleName = phoneTitleDao.findByTitleName(title);
        return byTitleName;
    }

    public List<PhoneTitle> getPhoneTitle(Integer id){
        List<PhoneTitle> phoneTitles = phoneTitleDao.findByCorrespondingAndIsDelete(id, Constant.NOT_DELETED);
        return phoneTitles;
    }


}
